<?php
/**
 * The world of warcraft armory library was created by Marc Binder. The called
 * product will be deployed by Tof Technologies, Germany. All sources contain to 
 * the New BSD Licence. Self created extensions can be contained in the hall of 
 * fame. So the community has the chance to get a overview of all parsers and
 * handlers, which are really effective.
 * 
 * Get more informations:
 * http://code.google.com/p/warcraftarmory/
 * 
 * @author      Marc Binder <marcandrebinder@gmail.com>
 * @copyright   (c) Tof Technologies, Germany - 2010
 * @license     New BSD Licence
 * @package     Wow_Armory
 * @version     $Id$
 */

/**
 * Wow_Armory_App_SetUp
 * 
 * @category    Wow_Armory
 * @package     App
 * @subpackage  SetUp
 * @example     n/A
 */
class Wow_Armory_App_SetUp
{
    
    /**
     * Includes the type development.
     * 
     * @var integer
     */
    const DEVELOPMENT = 1;
    
    /**
     * Contains the type live.
     * 
     * @var integer
     */
    const LIVE = 2;
    
    /**
     * Creates the object.
     * 
     * @return void
     */
    public function __construct()
    { }
    
    /**
     * Loads the exception class.
     * 
     * @return Wow_Armory_App_SetUp
     */
    public function loadExceptionClass()
    {
        require_once dirname(__FILE__) . '/../Exception.php';
        return $this;
    }
    
    /**
     * Loads the library.
     * 
     * @param  string $class
     * @param  string $method
     * @return Wow_Armory_App_SetUp
     */
    public function loadLibrary($class = 'Wow_Armory_App_Autoload', $method = 'autoload')
    {
        spl_autoload_register($class . '::' . $method);
        return $this;
    }
    
    /**
     * Loads the enviroment.
     * 
     * @param  string $name
     * @return Wow_Armory_App_SetUp
     */
    public function loadEnvironment($name)
    {
        if ($name == self::DEVELOPMENT) {
            error_reporting(E_ALL);
            display_errors(1);
            display_startup_errors(1);
        } elseif ($name == self::LIVE) {
            error_reporting(NULL);
            display_errors(0);
            display_startup_errors(0);
        }
        
        return $this;
    }
    
}